package com.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.data.HibernateSqlService;

@Controller
public class HibernateSqlQueryController {

	@Autowired
	private HibernateSqlService hibernateSqlService;

	
	@RequestMapping
	public ModelAndView SqlService(@RequestParam("sql") String sql) {
		return new ModelAndView("sqlService", "data", this.hibernateSqlService
				.find(sql));
	}
}
